package com.jial08.rabbitmqretry.domain;

import lombok.Getter;

/**
 * 消息队列枚举配置
 * Created by macro on 2018/9/14.
 */
@Getter
public enum QueueEnum {

    // 正常消息通知队列
    QUEUE_ORDER_PAY("mall.pay.topic", "mall.pay.topic.queue", "mall.pay.topic"),
    // 失败消息发送到重试队列
    QUEUE_ORDER_PAY_RETRY("mall.pay.topic.retry", "mall.pay.retry.queue", "mall.pay.retry"),
    // 重试队列到期后信息发送到死信队列重新消费，跟正常消息队列一样
    QUEUE_ORDER_PAY_DEAD("mall.pay.topic", "mall.pay.topic.retry", "mall.pay.topic"),
    // 失败超过一定次数后发到失败队列，统一记录异常信息
    QUEUE_ORDER_PAY_FAILD("mall.pay.topic.failed", "mall.pay.failed.queue", "mall.pay.failed");

    /**
     * 交换名称
     */
    private String exchange;

    /**
     * 路由键
     */
    private String routeKey;

    /**
     * 队列名称
     */
    private String name;


    QueueEnum(String exchange, String routeKey, String name) {
        this.exchange = exchange;
        this.routeKey = routeKey;
        this.name = name;
    }
}
